package org.sunshine.miracle.web.gwt.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.HistoryListener;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.layout.BorderLayout;
import com.extjs.gxt.ui.client.mvc.Dispatcher;

public class WebFileManager implements EntryPoint, HistoryListener {

    public void onModuleLoad() {


        Dispatcher dispatcher = Dispatcher.get();
        dispatcher.addController(new FileManagerControler());
        dispatcher.dispatch(GlobalEvents.Init);


//        final PathHistory pathHistory = new PathHistory();
//
//        Button b = new Button("Click me", new ClickListener() {
//            public void onClick(Widget sender) {
//                pathHistory.add("Hello, AJAX");
////            Window.alert("Hello, AJAX");
//            }
//        });
//
//        VerticalPanel verticalPanel = new VerticalPanel();
//        verticalPanel.setSpacing(10);
//        verticalPanel.add(pathHistory);
//        verticalPanel.add(b);
//
//
//        RootPanel.get().add(verticalPanel);
//
//        Element loadingElement = DOM.getElementById("loading");
////        loadingElement.getParentElement().removeChild(loadingElement.)
//
//        DOM.removeChild(DOM.getParent(loadingElement), loadingElement);
//
////        DOM.setElementProperty(loadingElement, "display", "none");

    }

    public void onHistoryChanged(String s) {
        //TODO
    }
}
